package com.groupbuying.customer.controller;

import com.groupbuying.customer.service.CustomerAliMainService;
import com.groupbuying.customer.utils.apiresult.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author: DavidBieber
 * @Email: davidbieber@163.com
 * @Date: 2019-09-27 16:43
 */
@Api("用户支付宝登陆接口")
@RestController
@RequestMapping("/alipay")
public class CustomerAliController {
    @Autowired
    private CustomerAliMainService customerAliMainService;
    
    /**
     * @api {post} /alipay/getLogin 用于支付宝用户账号登录接口
     * @apiExample
     * author yangmeng
     * tar TODO 未知调用方
     * date 2019/10/29 10:22
     * @apiGroup bus-customer
     * @apiVersion 1.0.0
     * @apiHeader {String} Authorization 用户授权token
     * @apiParam {String} mobile 用户手机号
     * @apiParam {String} password 账号密码
     * @apiParam {String} authcode 支付宝用户授权code
     * @apiSuccess {ApiResult} uShopLogin 够样主优店登录
     * @apiSuccess {ApiResult} goyoungLogin 够样主平台登录
     * @apiSuccess {ApiResult} success 用户名不存在
     */
    @ApiOperation(value = "账户登录接口", notes = "用于用户账户登录")
    @PostMapping("/getLogin")
    public ApiResult getLogin(@RequestParam Map<String, Object> params) {
        return customerAliMainService.customerLogin(params);
    }


}
